{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "initial_id",
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2024-03-06T08:17:34.284369Z",
     "start_time": "2024-03-06T08:17:34.229244Z"
    }
   },
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "outputs": [],
   "source": [
    "stock = \"sp500\""
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-03-06T08:17:34.306032Z",
     "start_time": "2024-03-06T08:17:34.288628Z"
    }
   },
   "id": "a0f8f6ae112594bb",
   "execution_count": 32
  },
  {
   "cell_type": "code",
   "outputs": [
    {
     "data": {
      "text/plain": "       instrument   datetime      open      high       low     close  \\\n0               A 2023-01-03  0.021356  0.021371  0.020960  0.021088   \n1             AAL 2023-01-03  0.001567  0.001559  0.001529  0.001538   \n2            AAPL 2023-01-03  0.018271  0.018228  0.017487  0.017533   \n3            ABBV 2023-01-03  0.022791  0.022770  0.022724  0.022845   \n4             ABT 2023-01-03  0.015457  0.015462  0.015283  0.015327   \n...           ...        ...       ...       ...       ...       ...   \n121258        YUM 2023-12-28  0.018350  0.018247  0.018373  0.018309   \n121259        ZBH 2023-12-28  0.016940  0.016981  0.017020  0.017043   \n121260       ZBRA 2023-12-28  0.038740  0.038798  0.038729  0.038931   \n121261       ZION 2023-12-28  0.006000  0.006041  0.006028  0.006083   \n121262        ZTS 2023-12-28  0.027854  0.027800  0.027830  0.027798   \n\n          volume     ret_1     label  \n0       0.001547  1.002606  1.010864  \n1       0.023920  1.001572  1.066719  \n2       0.122656  0.962595  1.010314  \n3       0.005402  1.004765  1.008067  \n4       0.004564  0.998087  1.014875  \n...          ...       ...       ...  \n121258  0.000965  0.997554  1.000000  \n121259  0.000724  1.004128  1.000000  \n121260  0.000212  0.998405  1.000000  \n121261  0.001232  1.003370  1.000000  \n121262  0.000963  1.001321  1.000000  \n\n[121263 rows x 9 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>instrument</th>\n      <th>datetime</th>\n      <th>open</th>\n      <th>high</th>\n      <th>low</th>\n      <th>close</th>\n      <th>volume</th>\n      <th>ret_1</th>\n      <th>label</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>A</td>\n      <td>2023-01-03</td>\n      <td>0.021356</td>\n      <td>0.021371</td>\n      <td>0.020960</td>\n      <td>0.021088</td>\n      <td>0.001547</td>\n      <td>1.002606</td>\n      <td>1.010864</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>AAL</td>\n      <td>2023-01-03</td>\n      <td>0.001567</td>\n      <td>0.001559</td>\n      <td>0.001529</td>\n      <td>0.001538</td>\n      <td>0.023920</td>\n      <td>1.001572</td>\n      <td>1.066719</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>AAPL</td>\n      <td>2023-01-03</td>\n      <td>0.018271</td>\n      <td>0.018228</td>\n      <td>0.017487</td>\n      <td>0.017533</td>\n      <td>0.122656</td>\n      <td>0.962595</td>\n      <td>1.010314</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>ABBV</td>\n      <td>2023-01-03</td>\n      <td>0.022791</td>\n      <td>0.022770</td>\n      <td>0.022724</td>\n      <td>0.022845</td>\n      <td>0.005402</td>\n      <td>1.004765</td>\n      <td>1.008067</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>ABT</td>\n      <td>2023-01-03</td>\n      <td>0.015457</td>\n      <td>0.015462</td>\n      <td>0.015283</td>\n      <td>0.015327</td>\n      <td>0.004564</td>\n      <td>0.998087</td>\n      <td>1.014875</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>121258</th>\n      <td>YUM</td>\n      <td>2023-12-28</td>\n      <td>0.018350</td>\n      <td>0.018247</td>\n      <td>0.018373</td>\n      <td>0.018309</td>\n      <td>0.000965</td>\n      <td>0.997554</td>\n      <td>1.000000</td>\n    </tr>\n    <tr>\n      <th>121259</th>\n      <td>ZBH</td>\n      <td>2023-12-28</td>\n      <td>0.016940</td>\n      <td>0.016981</td>\n      <td>0.017020</td>\n      <td>0.017043</td>\n      <td>0.000724</td>\n      <td>1.004128</td>\n      <td>1.000000</td>\n    </tr>\n    <tr>\n      <th>121260</th>\n      <td>ZBRA</td>\n      <td>2023-12-28</td>\n      <td>0.038740</td>\n      <td>0.038798</td>\n      <td>0.038729</td>\n      <td>0.038931</td>\n      <td>0.000212</td>\n      <td>0.998405</td>\n      <td>1.000000</td>\n    </tr>\n    <tr>\n      <th>121261</th>\n      <td>ZION</td>\n      <td>2023-12-28</td>\n      <td>0.006000</td>\n      <td>0.006041</td>\n      <td>0.006028</td>\n      <td>0.006083</td>\n      <td>0.001232</td>\n      <td>1.003370</td>\n      <td>1.000000</td>\n    </tr>\n    <tr>\n      <th>121262</th>\n      <td>ZTS</td>\n      <td>2023-12-28</td>\n      <td>0.027854</td>\n      <td>0.027800</td>\n      <td>0.027830</td>\n      <td>0.027798</td>\n      <td>0.000963</td>\n      <td>1.001321</td>\n      <td>1.000000</td>\n    </tr>\n  </tbody>\n</table>\n<p>121263 rows × 9 columns</p>\n</div>"
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_trade=pd.read_pickle(f\"{stock}fealab.pkl\")\n",
    "df_trade.rename(columns={'kdcode':'instrument','dt':'datetime'},inplace=True)\n",
    "df_trade['datetime'] = df_trade['datetime'].astype('datetime64[ns]')\n",
    "df_trade=df_trade[df_trade['datetime']>'2022-12-31']\n",
    "df_trade.reset_index(inplace=True,drop=True)\n",
    "df_trade"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-03-06T08:17:35.094393Z",
     "start_time": "2024-03-06T08:17:34.307100Z"
    }
   },
   "id": "de10c193e431244d",
   "execution_count": 33
  },
  {
   "cell_type": "code",
   "outputs": [
    {
     "data": {
      "text/plain": "(249,)"
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "index_date_unique=df_trade['datetime'].unique()\n",
    "index_date_unique.shape"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-03-06T08:17:35.110398Z",
     "start_time": "2024-03-06T08:17:35.095392Z"
    }
   },
   "id": "600e2d150a1c2c94",
   "execution_count": 34
  },
  {
   "cell_type": "code",
   "outputs": [],
   "source": [
    "df=pd.read_csv(f'{stock}/prediction/pred.csv')\n",
    "df.rename(columns={'dt':'datetime','kdcode':'instrument'},inplace=True)\n",
    "df['datetime']=df['datetime'].astype('datetime64[ns]')\n",
    "df_score=pd.DataFrame()\n",
    "for date in index_date_unique[:-1]:\n",
    "    loc=np.where(index_date_unique==date)\n",
    "    nextdate_loc=np.where(index_date_unique==date)[0][0]+1\n",
    "    for i in range(0,len(df)):\n",
    "        if df['datetime'][i]== date:\n",
    "            b={'datetime':index_date_unique[nextdate_loc],'instrument':df['instrument'][i],'score':df['score'][i]}\n",
    "            df_score=df_score._append(b,ignore_index=True)\n",
    "x=pd.merge(df_trade,df_score,on=['datetime','instrument'],how='outer')\n",
    "trade_date_unique=df_trade['datetime'].unique()\n",
    "df_return=pd.DataFrame()\n",
    "b={'datetime':trade_date_unique[0],'daily_return':0}\n",
    "df_return=df_return._append(b,ignore_index=True)\n",
    "for date in trade_date_unique[1:]:\n",
    "    x_day=x[x['datetime']==date]\n",
    "    r_day=x_day.nlargest(9,columns='score').ret_1.mean()\n",
    "    r_day=r_day-1\n",
    "    #r_day-=x_day.nsmallest(3,columns='score').close_r.mean()\n",
    "    b={'datetime':date,'daily_return':r_day}\n",
    "    df_return=df_return._append(b,ignore_index=True)"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-03-06T08:24:40.972175Z",
     "start_time": "2024-03-06T08:17:35.112399Z"
    }
   },
   "id": "304cea9d3bb486cd",
   "execution_count": 35
  },
  {
   "cell_type": "code",
   "outputs": [
    {
     "data": {
      "text/plain": "            daily_return\ndatetime                \n2023-01-03      0.000000\n2023-01-04      0.019496\n2023-01-05     -0.006820\n2023-01-06      0.025546\n2023-01-09      0.010218\n...                  ...\n2023-12-21      0.005227\n2023-12-22      0.004793\n2023-12-26      0.000200\n2023-12-27      0.001302\n2023-12-28      0.002733\n\n[249 rows x 1 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>daily_return</th>\n    </tr>\n    <tr>\n      <th>datetime</th>\n      <th></th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>2023-01-03</th>\n      <td>0.000000</td>\n    </tr>\n    <tr>\n      <th>2023-01-04</th>\n      <td>0.019496</td>\n    </tr>\n    <tr>\n      <th>2023-01-05</th>\n      <td>-0.006820</td>\n    </tr>\n    <tr>\n      <th>2023-01-06</th>\n      <td>0.025546</td>\n    </tr>\n    <tr>\n      <th>2023-01-09</th>\n      <td>0.010218</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>2023-12-21</th>\n      <td>0.005227</td>\n    </tr>\n    <tr>\n      <th>2023-12-22</th>\n      <td>0.004793</td>\n    </tr>\n    <tr>\n      <th>2023-12-26</th>\n      <td>0.000200</td>\n    </tr>\n    <tr>\n      <th>2023-12-27</th>\n      <td>0.001302</td>\n    </tr>\n    <tr>\n      <th>2023-12-28</th>\n      <td>0.002733</td>\n    </tr>\n  </tbody>\n</table>\n<p>249 rows × 1 columns</p>\n</div>"
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "portfolio_df_performance = df_return.set_index(['datetime'])\n",
    "portfolio_df_performance"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-03-06T08:24:40.988182Z",
     "start_time": "2024-03-06T08:24:40.973175Z"
    }
   },
   "id": "946ee049c604b664",
   "execution_count": 36
  },
  {
   "cell_type": "code",
   "outputs": [
    {
     "data": {
      "text/plain": "            daily_return\ndatetime                \n2023-01-03      1.000000\n2023-01-04      1.019496\n2023-01-05      1.012543\n2023-01-06      1.038409\n2023-01-09      1.049020\n...                  ...\n2023-12-21      1.494812\n2023-12-22      1.501976\n2023-12-26      1.502277\n2023-12-27      1.504232\n2023-12-28      1.508343\n\n[249 rows x 1 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>daily_return</th>\n    </tr>\n    <tr>\n      <th>datetime</th>\n      <th></th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>2023-01-03</th>\n      <td>1.000000</td>\n    </tr>\n    <tr>\n      <th>2023-01-04</th>\n      <td>1.019496</td>\n    </tr>\n    <tr>\n      <th>2023-01-05</th>\n      <td>1.012543</td>\n    </tr>\n    <tr>\n      <th>2023-01-06</th>\n      <td>1.038409</td>\n    </tr>\n    <tr>\n      <th>2023-01-09</th>\n      <td>1.049020</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>2023-12-21</th>\n      <td>1.494812</td>\n    </tr>\n    <tr>\n      <th>2023-12-22</th>\n      <td>1.501976</td>\n    </tr>\n    <tr>\n      <th>2023-12-26</th>\n      <td>1.502277</td>\n    </tr>\n    <tr>\n      <th>2023-12-27</th>\n      <td>1.504232</td>\n    </tr>\n    <tr>\n      <th>2023-12-28</th>\n      <td>1.508343</td>\n    </tr>\n  </tbody>\n</table>\n<p>249 rows × 1 columns</p>\n</div>"
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ARR = (1 + portfolio_df_performance).cumprod()\n",
    "ARR"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-03-06T08:24:41.019761Z",
     "start_time": "2024-03-06T08:24:40.990235Z"
    }
   },
   "id": "a84c7d63d3b5021e",
   "execution_count": 37
  },
  {
   "cell_type": "code",
   "outputs": [],
   "source": [
    "ARR.to_csv(f\"ARR/{stock}.csv\", index=None)"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-03-06T08:24:41.035128Z",
     "start_time": "2024-03-06T08:24:41.022138Z"
    }
   },
   "id": "db2dfa69f3631c6f",
   "execution_count": 38
  },
  {
   "cell_type": "code",
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\胡逸凡\\AppData\\Local\\Temp\\ipykernel_18636\\980728215.py:12: FutureWarning: 'm' is deprecated and will be removed in a future version, please use 'ME' instead.\n",
      "  monthly_statistics_df = alpha_df_performance[net_value_columns].resample('m').last()\n",
      "C:\\Users\\胡逸凡\\AppData\\Local\\Temp\\ipykernel_18636\\980728215.py:20: FutureWarning: 'y' is deprecated and will be removed in a future version, please use 'YE' instead.\n",
      "  yearly_statistics_df = alpha_df_performance[net_value_columns].resample('y').last()\n",
      "C:\\Users\\胡逸凡\\AppData\\Roaming\\Python\\Python310\\site-packages\\numpy\\core\\fromnumeric.py:3643: FutureWarning: The behavior of DataFrame.std with axis=None is deprecated, in a future version this will reduce over both axes and return a scalar. To retain the old behavior, pass axis=0 (or do not pass axis)\n",
      "  return std(axis=axis, dtype=dtype, out=out, ddof=ddof, **kwargs)\n",
      "C:\\Users\\胡逸凡\\AppData\\Roaming\\Python\\Python310\\site-packages\\numpy\\core\\fromnumeric.py:3643: FutureWarning: The behavior of DataFrame.std with axis=None is deprecated, in a future version this will reduce over both axes and return a scalar. To retain the old behavior, pass axis=0 (or do not pass axis)\n",
      "  return std(axis=axis, dtype=dtype, out=out, ddof=ddof, **kwargs)\n",
      "C:\\Users\\胡逸凡\\AppData\\Roaming\\Python\\Python310\\site-packages\\numpy\\core\\fromnumeric.py:3643: FutureWarning: The behavior of DataFrame.std with axis=None is deprecated, in a future version this will reduce over both axes and return a scalar. To retain the old behavior, pass axis=0 (or do not pass axis)\n",
      "  return std(axis=axis, dtype=dtype, out=out, ddof=ddof, **kwargs)\n"
     ]
    }
   ],
   "source": [
    "alpha_df_performance = pd.DataFrame()\n",
    "alpha_df_performance['portfolio_daily_return'] = portfolio_df_performance['daily_return']\n",
    "alpha_df_performance['portfolio_net_value'] = (alpha_df_performance['portfolio_daily_return'] + 1).cumprod()\n",
    "\n",
    "net_value_columns = ['portfolio_net_value']\n",
    "\n",
    "alpha_statistics_df = pd.DataFrame(index=alpha_df_performance[net_value_columns].columns,\n",
    "                                    columns=[\"年化收益\", \"年化波动率\", \"最大回撤率\", \"夏普率\", \"Calmar\", \"IR\"])\n",
    "\n",
    "# alpha_df_performance.set_index(\"dt\", inplace=True)\n",
    "alpha_df_performance.index = pd.to_datetime(alpha_df_performance.index)\n",
    "monthly_statistics_df = alpha_df_performance[net_value_columns].resample('m').last()\n",
    "monthly_statistics_df = pd.concat([alpha_df_performance[:1][\n",
    "                                        ['portfolio_net_value']],\n",
    "                                    monthly_statistics_df])\n",
    "monthly_statistics_df = monthly_statistics_df.pct_change()\n",
    "monthly_statistics_df = monthly_statistics_df.dropna()\n",
    "monthly_statistics_df.index = monthly_statistics_df.index.date\n",
    "## TODO 补充第一年的数据\n",
    "yearly_statistics_df = alpha_df_performance[net_value_columns].resample('y').last()\n",
    "yearly_statistics_df = pd.concat([alpha_df_performance[:1][\n",
    "                                        ['portfolio_net_value']],\n",
    "                                    yearly_statistics_df])\n",
    "yearly_statistics_df = yearly_statistics_df.pct_change()\n",
    "yearly_statistics_df = yearly_statistics_df.dropna()\n",
    "yearly_statistics_df.index = yearly_statistics_df.index.date\n",
    "\n",
    "alpha_statistics_df.loc[:, \"年化收益\"] = np.mean(\n",
    "    (alpha_df_performance[net_value_columns].tail(1)) ** (252 / len(alpha_df_performance)) - 1)\n",
    "alpha_statistics_df.loc[:, \"年化波动率\"] = np.std(\n",
    "    alpha_df_performance[net_value_columns] / alpha_df_performance[net_value_columns].shift(1) - 1) * np.sqrt(\n",
    "    252)\n",
    "alpha_statistics_df.loc[:, \"累积收益\"] = np.mean(alpha_df_performance[net_value_columns].tail(1) - 1)\n",
    "alpha_statistics_df.loc[:, \"累积波动率\"] = np.std(\n",
    "    alpha_df_performance[net_value_columns] / alpha_df_performance[net_value_columns].shift(1) - 1)\n",
    "alpha_statistics_df.loc[:, \"最大回撤率\"] = np.min(\n",
    "    (alpha_df_performance[net_value_columns] - alpha_df_performance[net_value_columns].cummax()) /\n",
    "    alpha_df_performance[net_value_columns].cummax())\n",
    "alpha_statistics_df.loc[:, \"夏普率\"] = alpha_statistics_df[\"年化收益\"] / alpha_statistics_df[\"年化波动率\"]\n",
    "alpha_statistics_df.loc[:, \"Calmar\"] = alpha_statistics_df[\"年化收益\"] / abs(alpha_statistics_df[\"最大回撤率\"])\n",
    "alpha_statistics_df.loc[:, \"IR\"] = np.mean(\n",
    "    alpha_df_performance[net_value_columns] / alpha_df_performance[net_value_columns].shift(1) - 1) * np.sqrt(\n",
    "    252) / np.std(alpha_df_performance[net_value_columns] / alpha_df_performance[net_value_columns].shift(1) - 1)"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-03-06T08:24:41.081307Z",
     "start_time": "2024-03-06T08:24:41.036131Z"
    }
   },
   "id": "10137830c6ab4c8b",
   "execution_count": 39
  },
  {
   "cell_type": "code",
   "outputs": [
    {
     "data": {
      "text/plain": "                        年化收益     年化波动率    最大回撤率       夏普率    Calmar        IR  \\\nportfolio_net_value  0.51583  0.153801 -0.11158  3.353886  4.622974  2.794464   \n\n                         累积收益     累积波动率  \nportfolio_net_value  0.508343  0.009689  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>年化收益</th>\n      <th>年化波动率</th>\n      <th>最大回撤率</th>\n      <th>夏普率</th>\n      <th>Calmar</th>\n      <th>IR</th>\n      <th>累积收益</th>\n      <th>累积波动率</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>portfolio_net_value</th>\n      <td>0.51583</td>\n      <td>0.153801</td>\n      <td>-0.11158</td>\n      <td>3.353886</td>\n      <td>4.622974</td>\n      <td>2.794464</td>\n      <td>0.508343</td>\n      <td>0.009689</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "alpha_statistics_df"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-03-06T08:24:41.113359Z",
     "start_time": "2024-03-06T08:24:41.086308Z"
    }
   },
   "id": "79b33c4b90789f8c",
   "execution_count": 40
  },
  {
   "cell_type": "markdown",
   "source": [
    "THGNN\n",
    "ASR = ARR / AVol;   CR = ARR / abs(MDD)\n",
    "        ARR    AVol    MDD    ASR    CR    IR\n",
    "hs300 -0.015  0.172  -0.152 -0.088 -0.100 -0.003\n",
    "\n",
    "zz500  0.048  0.128  -0.141  0.375  0.340  0.432\n",
    "\n",
    "sp500  0.516  0.154  -0.112  3.354  4.623  2.794\n",
    "   \n",
    "nas100 0.644  0.204  -0.146  3.147  4.414  2.543\n"
   ],
   "metadata": {
    "collapsed": false
   },
   "id": "dccf86d24af3e27b"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
